<template>
    <div>
        <el-dialog title="添加活动" v-model:model-value="props.visible" :before-close="beforeClose">
            <el-form label-width="100px">
                <el-form-item label="活动标题">
                    <el-input></el-input>
                </el-form-item>
                <el-form-item label="开始时间">
                    <el-input></el-input>
                </el-form-item>
                <el-form-item label="结束时间">
                    <el-input></el-input>
                </el-form-item>
                <el-form-item label="上线/下线">
                    <el-radio-group>
                        <el-radio :label="1" size="large">上线</el-radio>
                        <el-radio :label="0" size="large">下线</el-radio>
                    </el-radio-group>
                </el-form-item>
            </el-form>
            <template #footer>
                <span>
                    <el-button @click="onCancel">取消</el-button>
                    <el-button type="primary" @click="onConfirm">确定</el-button>
                </span>
            </template>
        </el-dialog>
    </div>
</template>

<script setup lang="ts">
import { defineProps, withDefaults, defineEmits, ref } from 'vue';
import * as api from '../../request/api'
// import useTabel from '../../hooks/useTables'
// import { useRouter } from 'vue-router'
// let router = useRouter()
// let date = new Date()
// let nian = date.getFullYear()
// let shangchuhequren = ref()
// let keyword = ref('')

let props = withDefaults(
    defineProps<{
        visible: boolean
    }>(), {
    visible: true
}
)
// 取消
let emits = defineEmits<
    {
        (event: 'cancel'): void;
    }
>()
let onCancel = () => {
    // props.visible = false
    emits('cancel')
}
// 确定
let onConfirm = () => {

}
let beforeClose = () => {
    emits('cancel')
}
</script>

<style scoped></style>